﻿CREATE TABLE [transaction].[TransactionItemCost] (
    [TransactionItemCostID]     INT             IDENTITY (1, 1) NOT NULL,
    [TransactionItemID]         INT             NULL,
    [TransactionItemCostTypeID] INT             NULL,
    [Value]                     DECIMAL (18, 2) NULL,
    [CreatedBy]                 VARCHAR (50)    NULL,
    [CreatedDate]               DATETIME        NULL,
    [UpdatedBy]                 VARCHAR (50)    NULL,
    [UpdatedDate]               DATETIME        NULL,
    [EndDate]                   DATETIME        NULL,
    CONSTRAINT [PK_TransactionItemCost] PRIMARY KEY CLUSTERED ([TransactionItemCostID] ASC),
    CONSTRAINT [FK_TransactionItemCost_TransactionItem] FOREIGN KEY ([TransactionItemID]) REFERENCES [transaction].[TransactionItem] ([TransactionItemID]),
    CONSTRAINT [FK_TransactionItemCost_TransactionItemCostType] FOREIGN KEY ([TransactionItemCostTypeID]) REFERENCES [transaction].[TransactionItemCostType] ([TransactionItemCostTypeID])
);

